<!--
 * @Descripttion: 
 * @Author: zhanyi
 * @Date: 2021-11-01 21:36:49
 * @FilePath: \wczd-mobile\src\pages\my-info\my-message-detil.vue
-->
<template>
  <div class="my-message-detil">
    <secondTopPanel>
      <div slot='title'>消息详情</div>
    </secondTopPanel>
    <evanForm ref="form" class="evan-form" :label-style="{width:'200upx',paddingRight:'20upx'}" :model='formData' hide-required-asterisk>
      <evanFormItem label='标题' prop="title">
				{{formData.title}}
      </evanFormItem>
      <evanFormItem label='用户名' prop="userName">
				{{formData.userName}}
      </evanFormItem>
      <evanFormItem label='来源' prop="msgType">
				{{formData.msgType}}
      </evanFormItem>
      <evanFormItem label='内容' prop="msg">
				{{formData.msg}}
      </evanFormItem>
    </evanForm>
  </div>
</template>

<script>
import secondTopPanel from '@/pages/component/top-panel/secondTopPanel.vue'
import evanForm from '@/components/evan-form/evan-form.vue'
import evanFormItem from '@/components/evan-form-item/evan-form-item.vue'
import { msgInfoOne,msgInfoEdit } from "@/api/user";
export default {
  name: 'my-message-detil',
  components: { secondTopPanel, evanForm, evanFormItem },
  data () {
    return {
      formData: {},
    }
  },
  computed: {},
  onLoad: function (option) {
    this._msgInfoOne(option)

  },
  watch: {},
  methods: {
    _msgInfoOne (data) {
      msgInfoOne({ id: data.id }).then(res => {
        this.formData = res.data
				
				if (res.data.isread === '0') {
				  msgInfoEdit({ id: res.data.id, userId: res.data.userId, isread: '1' }).then(res => {
				    console.log('标记已读');
				  })
				}
      })
    }
  },
}
</script>

<style scoped lang="scss">
.evan-form{
  padding-top: 120upx;
  margin-top: 0;
}
</style>
